package dynProg;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class ArrayHelper {
	
	
	public static int [] RemoveFromArray(int[] array, int index)
	{
		List list = ArrayToArrayList(array);
		list.remove(index);
		return ListToArray(list);
	}
	
	private static List ArrayToArrayList(int[] array)
	{
		List<Integer> arrayList = new ArrayList<Integer>();
		
		for(int i : array)
			arrayList.add(i);
		
		return arrayList;
	}
	
	private static int[] ListToArray(List list)
	{
		int[] intArray = new int[list.size()];
		for (int i = 0; i < list.size();i++)
			intArray[i] = (int) list.get(i);
		
		return intArray;
	}
}
